# libmymath.a: mul.o sub.o
# 	ar -rc $@ $^
# mul.o: mul.c
# 	gcc -c -o $@ $^
# sub.o: sub.c
# 	gcc -c -o $@ $^

# .PHONY:output
# output:
# 	mkdir -p mylib/include     
# 	mkdir -p mylib/lib
# 	cp -f *.a mylib/lib
# 	cp -f *.h mylib/include

# .PHONY:clean
# clean:
# 	rm -rf *.o libmymath.a mylib

libmymath.so: mul.o sub.o 
	gcc -shared -o $@ $^
mul.o: mul.c
	gcc -fPIC -c -o $@ $^
sub.o: sub.c
	gcc -fPIC -c -o $@ $^

.PHONY:output    
output:
	mkdir -p mylib/include     
	mkdir -p mylib/lib
	cp -f *.so mylib/lib
	cp -f *.h mylib/include

.PHONY:clean 
clean:
	rm -rf *.o libmymath.so mylib